<style scoped lang="scss">
@import "@/styles/_variables.scss";
@import "@/styles/_mixins.scss";

.follow-box {
  width: 10rem;
  height: 100%;
  display: flex;
  flex-direction: column;

  .follow-header {
    width: 100%;
    height: 100%;
    /* 保留容器样式，滑动逻辑在组件内部处理 */
  }
}
</style>
<template>
  <div class="follow-box">
    <div class="follow-header">
      <!-- 引入封装的组件，传递视频列表 -->
      <UserDynamicList :current-video="currentVideo" />
    </div>
  </div>
  <CommentSection />
</template>

<script setup>
import { getFollowedListAPI } from "@/api/followed/followed";
import { useUserStore } from "@/store/modules/user/user";
import CommentSection from '@/components/common/commentSection.vue';
import UserDynamicList from '@/components/common/UserDynamicCard.vue';
import { ref, onMounted } from "vue";

const userStore = useUserStore();
const userId = userStore.userInfo.userId;
const currentVideo = ref([]); // 存储视频列表

// 获取关注列表
const getFollowedList = async () => {
  const res = await getFollowedListAPI(userId);
  if (res.code === 200) {
    currentVideo.value = res.data;
  }
}

onMounted(() => {
  getFollowedList();
});
</script>
